#include <stdio.h>

int gcd(int a,int b)
{
	while(1)
	{
		int c=a%b;
		if(c==0)
		return b;
		else
		{	
			a=b;
			b=c;
		}
	}
}

int lcm(int a,int b,int ret1)
{
	return (a*b/ret1);
}

int main()
{
	int num1=0;
	int num2=0;
	scanf("%d %d",&num1,&num2);
	int ret1=gcd(num1,num2);
	int ret2=lcm(num1,num2,ret1);
	printf("%d %d",ret1,ret2);
	return 0;
}